home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / mus / misc / octaflip.lha / flipblock_nocmd.omed < prev    next >
Encoding:
Text File  |  1998-10-07  |  1.5 KB  |  55 lines

  1. /*    flipblock_nocmd.omed - arexx-script for octamed.
  2.      Flips the block, but not the cmd-pages.
  3.     Made by Kjetil S. Matheussen 1998.
  4.  
  5.     Based on an arexx-script made by David T. Krupicz.
  6.     Changes: Rewritten it to work properly, removed cmd-page,
  7.     included all tracks in block, included highlight-flip,
  8.     and improoved speed with around 75%.
  9. */
  10.  
  11. OPTIONS RESULTS
  12.  
  13. ed_getnumtracks VAR numtracks
  14. ed_getnumpages VAR numpages
  15.  
  16. ed_getnumlines VAR rn_end
  17. rn_end=rn_end-1
  18. length = rn_end/2
  19.  
  20. op_update off
  21. DO e=0 to length    /* flip highlights first */
  22.     drop top_high bot_high
  23.     ed_getlinehighlight e VAR top_high
  24.     ed_getlinehighlight rn_end-e VAR bot_high
  25.     if ~(bot_high=top_high) then do
  26.         if bot_high=1 then do
  27.             ed_highlightline rn_end - e OFF
  28.             ed_highlightline e ON
  29.         end;else do
  30.             ed_highlightline rn_end - e ON
  31.             ed_highlightline e OFF
  32.         end
  33.     end
  34. END
  35. op_update on
  36.  
  37. DO r = 0 to numtracks-1
  38.     op_update off
  39.     DO i = 0 to length
  40.         drop top_note top_inum bot_note bot_inum
  41.         ed_getdata 't' r 'l' i 'note' VAR top_note          /* get top note data */
  42.         ed_getdata 't' r 'l' i 'inum' VAR top_inum
  43.         ed_getdata 't' r 'l' rn_end - i 'note' VAR bot_note          /* get BOTtom note data */
  44.         ed_getdata 't' r 'l' rn_end - i 'inum' VAR bot_inum
  45.         if ~(bot_note=top_note) then do
  46.             ed_setdata 't' r 'l' i 'note' bot_note
  47.             ed_setdata 't' r 'l' rn_end - i 'note' top_note
  48.         end
  49.         if ~(bot_inum=top_inum) then do
  50.             ed_setdata 't' r 'l' i 'inum' bot_inum
  51.             ed_setdata 't' r 'l' rn_end - i 'inum' top_inum
  52.         end
  53.     END
  54.     op_update on
  55. END